import type { VirtuallyRelationSaveOrUpdateParams } from '@/types'

const controller = getAjaxBaseUrl(
  '/virtuallyRelation',
  '/energy',
)

/** 保存或修改虚拟指标相关信息 */
export function saveOrUpdate(params: VirtuallyRelationSaveOrUpdateParams) {
  return post(`${controller}/saveOrUpdateBatchRelation`, params)
}

/** 查询虚拟指标相关信息列表 */
export function queryList(virtuallyIndicatorId: number) {
  return get<any[]>(`${controller}/loadVirtuallyRelationList`, {
    virtuallyIndicatorId,
  })
}

/** 删除虚拟指标相关信息 */
export function deleteById(id: number) {
  return get(`${controller}/deleteVirtuallyRelation`, { id })
}
